package org.bangumibuddy.pojo.anime;

import lombok.Data;

import java.util.Objects;

@Data
public class AnimeMetaData {
    String group;
    String title_en;
    String title_jp;
    String title_zh;
    int season;
    int episode;
    String source;
    String collectionEpisode;

    public String getTitle(){
        if(title_zh != null && !title_zh.isEmpty()){
            return title_zh;
        }
        if(title_jp != null && !title_jp.isEmpty()){
            return title_jp;
        }
        return title_en;
    }

    public String getSavePath(){
        if(episode == -1)
            return getTitle()+"/S"+getSeason();

        return getTitle()+"/S"+getSeason()+"/["+getGroup()+"]";
    }

    public String getSaveFileName(){
        if(episode == -1)
            return getTitle()+" - S"+getSeason()+" "+getCollectionEpisode();

        return getTitle()+" - S"+getSeason()+"E"+getEpisode();
    }
}
